home *** CD-ROM | disk | FTP | other *** search
- Path: ghost.shsu.edu!usenet
- From: Gary Frost <grfcon@netropolis.net>
- Newsgroups: comp.lang.c++
- Subject: Re: memcopy...
- Date: Mon, 15 Apr 1996 13:38:14 -0500
- Organization: G.R.F Contracts U.K Ltd
- Message-ID: <31729796.F85@netropolis.net>
- References: <4ksiul$n1o@news.duke.edu> <317239A2.41C6@dopey.uibk.ac.at>
- NNTP-Posting-Host: 205.241.79.114
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4d)
-
- Herwig Stecher wrote:
- >
- > > Hi...I'm wondering if anyone knows the syntax for the memcopy function
- > > (well, I think it's memcopy...it might be something similar to
- > > memcopy...it's the function that copies some specified area of memory
- > > bitwise into some other area of memory). This would be very helpful;
- > > thanks much.
- > >
- > The syntax for the memcpy function is:
- >
- > #include <string.h>
- > memcpy(target,start,size);
- >
- > where "start" is a pointer to the adress from where you want to copy
- > something to the memory location where "target" points to.
- > "size" is the amount of data you want to copy.
- > e.g.
- >
- > int *target;
- > int start[10];
- > target = new int[10];
- > memcopy(target, start, sizeof(int)*10);
- >
- > will copy the data in the array start.
-
- Beware of possible problems with overlapping memory. Check out memmove() also.
-
- Gary
-